﻿@{
    Layout = null;
}
@using MvcContrib.UI.Grid;
@using Webdiyer.WebControls.Mvc;
@model PagedList<ElingOA6_Admin_DSJCJ.Model.Task>

<!DOCTYPE html>
<html>
<head>
    <title>@ViewData["title"]列表</title>
     @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
        <link href="@Url.Content("~/Content/listTable.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
   <script>

       $(document).ready(function () {
       $("#cx_wcqk").val("@ViewData["qk"]");
       });


       function Search() {
           window.location.href = rootPath + "/Admin/FrontShow/TaskShow?lb2=" + $("#cx_lb").val() + "&&qk=" + $("#cx_wcqk").val() + "&&type=Q&&showlb=" + $("#hdshowLB").val() + "&&lb=" + $("#hdlb").val() + "";
       }

       function iframeAutoFit() {
            var ex;
            try {
                if (window != parent) {
                    var a = parent.document.getElementsByTagName("IFRAME");
                    for (var i = 0; i < a.length; i++) {
                        if (a[i].contentWindow == window) {
                            var h1 = 0, h2 = 0;
                            if (document.documentElement && document.documentElement.scrollHeight) {
                                h1 = document.documentElement.scrollHeight;
                            }
                            if (document.body) h2 = document.body.scrollHeight;
                            var h = Math.max(h1, h2);
                            if (window.ActiveXObject) { h += 4; }
                            else { h += 4; }
                            a[i].style.height = h + "px";
                            window.removeEventListener('resize', iframeAutoFit, false); //兼容谷歌浏览器时要去掉RISZE监听
                        }
                    }
                }
            }
            catch (ex) { }
        }
    
   </script>
</head>
<body style=" font-size:12px"  onload="iframeAutoFit()"> 
    <br />
    <table width="900px" border="0" cellspacing="0" cellpadding="0" align="center" style=" border:0px">
        <tr>
            <td height="20" align="left" style=" border:0px; width:440px">
                <font color="black" size="3" style="font-weight: bold">@ViewData["title"]列表</font></td>
       
                                  <td align="right" style=" border:0px ;width:40px">
                <b> 类别:</b> 
                </td>
                <td align="left" style=" border:0px;width:40px">
                <select name="cx_lb" id="cx_lb">
                 		  <option value="">请选择状态进行查询</option>
                 @foreach (ElingOA6_Admin_DSJCJ.Model.CdTaskClass CdTaskClassmodel in ViewData["CdTaskClassList"] as List<ElingOA6_Admin_DSJCJ.Model.CdTaskClass>)
                 {
                          <option value="@CdTaskClassmodel.FTaskClassCd">@CdTaskClassmodel.FTaskClassName</option>
                 }
                        </select>
                 </td>
                 <td align="right" style=" border:0px; text-align:right;width:70px">
               <b>  完成情况: </b>
               </td>
               <td align="left" style=" border:0px; text-align:left">
               <select name="cx_wcqk" id="cx_wcqk">
						  <option value="">请选择状态进行查询</option>
                          <option value="1">正在处理</option>
                          <option value="2">未确认</option>
                          <option value="21">已办结</option>
                          <option value="22">已完成（扣）</option>
                          <option value="3">超期</option>
                          <option value="4">未完成</option>
                          <option value="5">撤消</option>
                        </select>
                 </td>
                 <td align="center" style=" border:0px">
                 <input type="button" onclick="Search()" title="查询"value="查询" />
                 </td>
        </tr>
        
    </table>
    <hr  style=" width:900px;height:2px"/>
   <table width="900px" border="0" align="center" cellpadding="0" cellspacing="0"  class="listTable" >
            <tr>
                <td width="10%" height="31" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "类型"; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                    </font></td>
                <td width="35%" height="31" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "文件编号（督查事项)"; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                    </font></td>
                <td width="10%" height="31" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "责任科室"; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                    </font></td>
                <td width="10%" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "分值"; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                    </font></td>
                <td width="10%" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "登记时间"; settings.Properties.Style.Font.Size = 9; }).GetHtml()
                    </font></td>
                   <td width="15%" align="center" ><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "超期时间"; settings.Properties.Style.Font.Size = 9; }).GetHtml()
                    </font></td>
                <td width="10%" align="center"><font>
                     @Html.DevExpress().Label(settings => { settings.Text = "完成情况"; settings.Properties.Style.Font.Size = 9; }).GetHtml()
                   </font></td>
                    
            </tr>
            @if (@Model.TotalItemCount != 0)
            {
                int i = @Model.CurrentPageIndex;
                i = (i - 1) * 15 + 1;
                foreach (var item in Model)
                { 
                <tr class="listStyle">
                     <td  align="center" >
                         @Html.DevExpress().Label(settings => { settings.Text = item.FTaskClassName; settings.Properties.Style.Font.Size =9; }).GetHtml() 
                    </td>
                    <td  height="31" style=" font-size:12px" >
                        &nbsp;<a href= "@Url.Content("~/Admin/FrontShow/TaskLook?taskID="+item.FTaskID)" target="_blank">
                        @item.FContent
                        </a> </td>
                    <td  align="center" >
                         @Html.DevExpress().Label(settings => { settings.Text = item.FDeptName; settings.Properties.Style.Font.Size =9; }).GetHtml() 
                    </td>
                    <td  align="center" >
                      @Html.DevExpress().Label(settings => { settings.Text = item.FScore.ToString(); settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                       </td>
                          <td  align="center" >
                      @Html.DevExpress().Label(settings => { settings.Text = item.FInsDateStr.ToString(); settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                       </td>
                     <td  align="center" >
                     
              @if (DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")) > DateTime.Parse(item.FEndDateStr))
                        {
                            if(item.FStatus=="1")
                            {
                  
                             @Html.DevExpress().Label(settings => { settings.Text = item.FEndDateStr; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                             <font color=red size=2>已超时</font>
                  }
                  else
                  {
                     @Html.DevExpress().Label(settings => { settings.Text = item.FEndDateStr; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
                  }
                        }
              else
              {
                            @Html.DevExpress().Label(settings => { settings.Text = item.FEndDateStr; settings.Properties.Style.Font.Size = 9; }).GetHtml() 
              }</td>

                     <td  align="center" >@Html.DevExpress().Label(settings => { settings.Text = item.FStatusStr; settings.Properties.Style.Font.Size = 9; }).GetHtml()</td>
                </tr>
              i = i + 1;
                }

            }
            else
            {
                <tr>
                    <td align="center" colspan="4" style=" font-size:14px">
                        
                           <b> 暂无数据</b>
                    </td>
                </tr>
            }
            @*<tr>
                <td align="center" colspan="4">
                    <span style="float: left; width: 30%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共 @Model.TotalItemCount 条记录，页 @Model.CurrentPageIndex/@Model.TotalPageCount </span>
                    @Html.Pager(Model, new PagerOptions { ContainerTagName = "span", PageIndexParameterName = "id", AlwaysShowFirstLastPageNumber = true, HorizontalAlign = "right", FirstPageText = "第一页", LastPageText = "最后一页 " }, new { style = "float:right;width:70%" })
                </td>
                </tr>*@
        </table>
        <table width="900px" border="0" cellspacing="0" cellpadding="0" align="center" style=" border:0px" >
            <tr class="">
                <td style=" border:0px">
                    <a><span style="float: left; width: 25%">&nbsp;共 @Model.TotalItemCount 条记录，页 @Model.CurrentPageIndex/@Model.TotalPageCount </span></a>
                    @Html.Pager(Model, new PagerOptions { ContainerTagName = "span", PageIndexParameterName = "id", AlwaysShowFirstLastPageNumber = true, HorizontalAlign = "right", FirstPageText = "第一页", LastPageText = "最后一页 " }, new { style = "float:right;width:75%" })
                </td>
            </tr>
        </table>

    @Html.Hidden("hdlb", ViewData["lb"])        
    @Html.Hidden("hdshowLB", ViewData["showLB"])      
</body>
</html>
